package c.e.a.b.f.b;

import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Pair;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class f6 implements Runnable {
    public final /* synthetic */ c6 a;

    public f6(c6 c6Var) {
        this.a = c6Var;
    }

    public final void run() {
        y9 y9Var = this.a.n;
        y9Var.a.a().g();
        if (y9Var.c()) {
            String str = "_cc";
            if (y9Var.b()) {
                y9Var.a.o().A.b(null);
                Bundle bundle = new Bundle();
                String str2 = "(not set)";
                bundle.putString("source", str2);
                bundle.putString("medium", str2);
                bundle.putString("_cis", "intent");
                bundle.putLong(str, 1);
                y9Var.a.s().H("auto", "_cmpx", bundle);
            } else {
                String a = y9Var.a.o().A.a();
                if (TextUtils.isEmpty(a)) {
                    y9Var.a.d().g.a("Cache still valid but referrer not found");
                } else {
                    long a2 = ((y9Var.a.o().B.a() / 3600000) - 1) * 3600000;
                    Uri parse = Uri.parse(a);
                    Bundle bundle2 = new Bundle();
                    Pair pair = new Pair(parse.getPath(), bundle2);
                    for (String str3 : parse.getQueryParameterNames()) {
                        bundle2.putString(str3, parse.getQueryParameter(str3));
                    }
                    ((Bundle) pair.second).putLong(str, a2);
                    y9Var.a.s().H((String) pair.first, "_cmp", (Bundle) pair.second);
                }
                y9Var.a.o().A.b(null);
            }
            y9Var.a.o().B.b(0);
        }
    }
}
